package com.huitone.gddw.service.impl.worktable;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huitone.gddw.dao.entity.PrgDispatchNotify;
import com.huitone.gddw.dao.entity.PrgDispatchNotify.DispatchStatus;
import com.huitone.gddw.dao.worktable.paramconfigmanage.IPrgDispatchNotifyDao;
import com.huitone.gddw.service.IPrgDispatchNotifyService;
import com.huitone.gddw.utils.SysLoginUtil;

/**
* @Title PrgDispatchNotifyService
* @Package com.huitone.gddw.service.impl
* @Description TODO
* @author chengsiyue
* @date 2017年5月5日 上午10:08:23
* @version V1.0   
*/
@Service
public class PrgDispatchNotifyService implements IPrgDispatchNotifyService{

	@Autowired
	private IPrgDispatchNotifyDao prgDispatchNotifyDao;
	
	@Override
	public PrgDispatchNotify getLastByPrgId(String prgId) {
		return prgDispatchNotifyDao.getLastByPrgId(prgId);
	}
	
	@Override
	public void save(PrgDispatchNotify record) {
		record.setInsertStaffId(SysLoginUtil.getLoginUserId());
		record.setInsertTime(new Date());
		record.setDispatchStatus(DispatchStatus.WAIT.getCode()); //等待调度
		int code = prgDispatchNotifyDao.save(record);

	}
	@Override
	public PrgDispatchNotify selectByPrimaryKey(String recId) {
		return prgDispatchNotifyDao.selectByPrimaryKey(recId);
	}
	@Override
	public int updateByPrimaryKeySelective(PrgDispatchNotify record) {
		return prgDispatchNotifyDao.updateByPrimaryKeySelective(record);
	}

}
